package hk.linkcredit.common.rocketmq.example;

import hk.linkcredit.common.rocketmq.listener.ITransactionHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ExampleTransactionHandler implements ITransactionHandler<ExampleDTO> {
    @Override
    public void processTransaction(ExampleDTO exampleDTO,String msgId) {
        //处理事务
        log.info("处理本地事务");
    }

    @Override
    public boolean checkTransaction(String bizId, String msgId) {
        //查询事务是否处理成功
        log.info("根据事务id+业务id查询本地事务是否提交成功");
        return true;
    }
}
